<?php
/**
 * Zhub - A PHP Framework For API Developer
 *
 * This file is part of the Zhub package.
 *
 * (c) YiLong Fan <fantiq@163.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author fanyilong <fantiq@163.com>
 * @copyright 2017 fanyilong. All rights reserved.
 * @package Zhub
 * @date 18-3-5
 */

namespace Zhub\Route;


use Zhub\DataStruct\Maps\HashMap;
use Zhub\DataStruct\Struct;
use Zhub\HttpMessage\RequestMethod;

class RouteStruct extends Struct
{
    //
    const METHOD = 'method';
    //
    const PATH = 'path';
    //
    const HANDLE = 'handle';
    //
    const PARAMETERS = 'parameters';
    //
    const PIPES = 'pipes';
    //
    const DATA = 'data';

    public static function initialize():array
    {
        return [
            self::METHOD => RequestMethod::GET,
            self::PATH => '/',
            self::HANDLE => '',
            self::PARAMETERS => function () {return HashMap::class;},
            self::PIPES => [],
            self::DATA => [],

        ];
    }

    public function getMethod():int
    {
        return parent::get(self::METHOD);
    }

    public function setMethod(int $method):self
    {
        parent::set(self::METHOD, $method);
        return $this;
    }

    public function getPath():string
    {
        return parent::get(self::PATH);
    }

    public function setPath(string $path):self
    {
        parent::set(self::PATH, $path);
        return $this;
    }

    public function getHandle():string
    {
        return parent::get(self::HANDLE);
    }

    public function setHandle(string $handle):self
    {
        parent::set(self::HANDLE, $handle);
        return $this;
    }

    public function getParameters():array
    {
        return parent::get(self::PARAMETERS);
    }

    public function setParameters(array $parameters):self
    {
        parent::set(self::PARAMETERS, $parameters);
        return $this;
    }

    public function getData(): array
    {
        return parent::get(self::DATA);
    }

    public function setData( $data):self
    {
        parent::set(self::DATA, $data);
        return $this;
    }
    public function getPipes(): array
    {
        return parent::get(self::PIPES);
    }

    public function setPipes(array $pipes):self
    {
        parent::set(self::PIPES, $pipes);
        return $this;
    }
}